/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package edu.ccut.titan.component;

import java.util.Collection;
import java.util.Set;

/**
 * Record all component information in a Bundle.
 * TODO:Record all date information in a Bundle
 * TODO:Recode all sca information in a Bundle
 * <p>
 * There are three component type in a bundle. include:
 * <li>1. base component define in /META-INF/titan-component.xml
 * <li>2. logic component define in /** /*.logic.xml
 * <li>3. action component define in /** /*.action.xml
 * 
 * @author LeslieGu
 */
public interface IBundleInfo {

	/**
	 * Get bundle symbolic name
	 * 
	 * @return
	 */
	public String getBundleSymbolicName();
	
	/**
	 * Get web root path
	 */
	public String getWebRootPath();
	
	/**
	 * Set web root path
	 * @param path;
	 */
	public void setWebRootPath(String path);

	/**
	 * Get all component information in this bundle
	 * 
	 * @return
	 */
	public Collection<IComponentInfo> getComponentInfos();

	/**
	 * Get all component key set
	 * 
	 * @return
	 */
	public Set<String> getComponentKeys();

	/**
	 * Get component information by component key
	 * 
	 * @param componentKey
	 * @return
	 */
	public IComponentInfo getComponentInfo(String componentKey);

	/**
	 * Add a component information
	 * 
	 * @param componentInfo
	 * @throws TitanComponentException
	 */
	public void addComponentInfo(IComponentInfo componentInfo)
			throws TitanComponentException;

	/**
	 * Add component information List
	 * 
	 * @param componentInfos
	 * @throws TitanComponentException
	 */
	public void addComponentInfos(Collection<IComponentInfo> componentInfos)
			throws TitanComponentException;
}
